<?php
namespace app\home\controller;

class Vip extends \think\Controller
{
    public function index()
    {
        $url = $this->request->get('url', '', 'urldecode');
        $site = $this->request->get('site');

        $config = [
            ['src' => '//jx.618g.com/?url=', 'type' => ''],
            ['src' => '//www.heimijx.com/jx/api/?url=', 'type' => ''],
            ['src' => '//cdn.yangju.vip/k/?url=', 'type' => ''],
            ['src' => '//www.cmys.tv/?url=', 'type' => ''],
            ['src' => '//jx.daheiyun.com/?url=', 'type' => ''],
            ['src' => '//jx.618ge.com/file/pc.html?url=', 'type' => ''],
            ['src' => '//jx.hezeshi.net/ce/jlexi.php?url=', 'type' => ''],
            ['src' => '//jx.km58.top/jx/?url=', 'type' => ''],
        ];

        if ($site !== 0 && !isset($config[$site])) {
            $site = rand(0, 7);
        }

        $play_url = '';
        if ($url) {
            $play_url = $config[$site]['src'] . $url;
        }

        $this->assign('site', $site);
        $this->assign('play_url', $play_url);
        $this->assign('url', $url);
        $this->assign('sites', $config);
        $this->assign('meta_desc', 'VIP视频解析,腾讯视频解析,优酷视频解析,芒果TV视频解析,腾讯VIP,优酷VIP');
        $this->assign('meta_keywords', 'VIP视频解析,腾讯视频解析,优酷视频解析,芒果TV视频解析,腾讯VIP,优酷VIP');
        $this->assign('meta_title', 'VIP视频解析_腾讯视频解析_优酷视频解析_芒果TV视频解析_BTFILM影视搜索_BTFILM电影搜索');

        header('Cache-control: max-age=360');
        return $this->fetch();
    }


    public function help()
    {
        $this->assign('meta_desc', 'VIP视频解析,腾讯视频解析,优酷视频解析,芒果TV视频解析,腾讯VIP,优酷VIP');
        $this->assign('meta_keywords', 'VIP视频解析,腾讯视频解析,优酷视频解析,芒果TV视频解析,腾讯VIP,优酷VIP');
        $this->assign('meta_title', 'VIP视频解析_腾讯视频解析_优酷视频解析_芒果TV视频解析_BTFILM影视搜索_BTFILM电影搜索');
        header('Cache-control: max-age=864000');
        return $this->fetch();
    }
}
